package com.woniu.darryringmall.front.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.darryringmall.front.entity.Goods;
import com.woniu.darryringmall.front.entity.History;
import com.woniu.darryringmall.front.entity.HistoryGoods;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用户浏览历史表Mapper接口
 */
public interface HistoryMapper extends BaseMapper<History> {

    @Select("select h.id,g.id gid,g.name,g.image, h.historyTime from mall_history h,mall_user u,mall_goods g where h.userId=u.id and h.goodsId=g.id and h.userId=#{userId} order by h.historyTime desc")
    List<HistoryGoods> getHistoryByUserId(int userId);
}
